#ifndef UART_H
#define UART_H
/* Includes ------------------------------------------------------------------*/
#include "common.h"

/* Exported macros -----------------------------------------------------------*/
#define UART_PARITY_NONE		0
#define UART_PARITY_ODD			1
#define UART_PARITY_EVEN		2
#define UART_STOP_BITS_1		0
#define UART_STOP_BITS_0_5		1
#define UART_STOP_BITS_2		2
#define UART_STOP_BITS_1_5		3

/* Exported functions --------------------------------------------------------*/
void 			UARTx_Init(unsigned long ulPort, unsigned long ulBaudRate, unsigned long ulParity, unsigned long ulStopBits);
void 			UARTx_EnableIT(unsigned long ulPort, bool bIdle, bool bTxe, bool bTc, bool bRxne);
void 			UARTx_SetPriority(unsigned long ulPort, unsigned long ulPriority);
void 			UARTx_Send(unsigned long ulPort, unsigned char * pucData, unsigned long ulLen);
void 			UARTx_SendToDR(unsigned long ulPort, unsigned char ucData);
unsigned char 	UARTx_Receive(unsigned long ulPort);
void 			UARTx_SetCallBack(unsigned long ulPort, void (*pFuncIdleCallBack)(void), void (*pFuncTxeCallBack)(void), void (*pFuncTcCallBack)(void), void (*pFuncRxneCallBack)(void));
#endif
